package algotithm.interview.gensheixueGo.test3;

import java.io.*;

/**
 * @author zhouyanxiang
 * @Date 2021-04-2021/4/15-16:00
 */
public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

        int n = Integer.parseInt(reader.readLine());
        int i = 2;
        int j = n - 2;
        int max = 0;
        int x = 0;
        int y = 0;
        while (i < j) {
            if (isPrim(i) && isPrim(j) && i + j == n) {
                max = Math.max(j - i,max);
                x = i;
                y = j;
                break;
            }
            i++;
            j--;
        }
        writer.write(i + " "  + j + "\n");
        writer.flush();
        writer.close();
        reader.close();
    }

    public static boolean isPrim(int n) {
        if ( n < 2) {
            return false;
        }
        int r = (int) Math.sqrt(n);
        for (int i = 2;i <= r; i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }
}
